package com.mt.skyhoist.ui.activity;

import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.mt.skyhoist.R;
public class InformationFragment extends Fragment {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}

	private View view;
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		if (view != null) {
			return view;
		}

		view = inflater.inflate(R.layout.fragment_information, container, false);

		initView();

		return view;
	}

	// 初始化控件
	private TextView temp_txt;
	private TextView humidity_txt;
	private TextView carbon_txt;
	private void initView(){
		temp_txt = (TextView) view.findViewById(R.id.temp_txt);
		humidity_txt = (TextView) view.findViewById(R.id.humidity_txt);
		carbon_txt = (TextView) view.findViewById(R.id.carbon_txt);
	}
	
	public void setTemp(int temp){
		if(temp_txt == null){
			return;
		}
		temp_txt.setText(""+temp);
	}
	public void setHumidity(int humidity){
		if(humidity_txt == null){
			return;
		}
		humidity_txt.setText(""+humidity);
	}
	public void setCarbon(int carbon){
		if(carbon_txt == null){
			return;
		}
		carbon_txt.setText(""+carbon);
	}
}
